<template>
	<view class="pad-30">
		<view v-for="(item,index) in list" @click="hanldeInfo(item.id)">
			<view class="title mar-top-30">{{item.title}}</view>
			<view class="mar-top-30">所属项目： {{item.cate_title}}</view>
			<view class="flex mar-top-30">
				<up-button class="mar-right-50" type="error">得分：{{item.score}}</up-button>
				<up-button type="primary" plain>总分：{{item.total_score}}</up-button>
			</view>

			<up-line margin="30rpx 0 0 0"></up-line>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';

	// 接口引入
	import {
		finishList
	} from '/config/api.js';

	import {
		onLoad,
		onReachBottom
	} from '@dcloudio/uni-app'

	// 跳转详情
	const hanldeInfo = (id) => {
		uni.navigateTo({
			url: '/pages/achieInfo/achieInfo?id=' + id,
		})
	}

	// 获取列表
	let params = reactive({
		page: 1,
		page_size: 15
	})

	let list = ref([])
	const getListInfo = () => {
		finishList(params).then(({
			data
		}) => {
			list.value = list.value.concat(data.data)
		})
	}

	// 页面初始化
	onLoad(() => {
		getListInfo()
	})

	// 上拉加载更多
	onReachBottom(() => {
		getListInfo();
	})
</script>

<style>

</style>